<template>
  <div>
    <ul>
      <li v-for="item in list" :key="item.id">
        <router-link tag="a" :to="'/details?id='+item.id">{{item.courseName}}</router-link>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data(){
    return {
      list: []
    }
  },
  methods: {
    // 列表
    fromList(){
      this.$ajax({
        url: 'selectCourseByCategoryId'
      }).then(res=>{
        if(res.code == 1){
          this.list = res.data
        }
      })
    }
  },
  created(){
    this.fromList()
  }
}
</script>

<style>

</style>
